summaryrefslogtreecommitdiffstats
path: root/glucometerutils/support/tests/test_freestyle.py
diff options
context:
space:
mode:
Diffstat (limited to 'glucometerutils/support/tests/test_freestyle.py')
-rw-r--r--glucometerutils/support/tests/test_freestyle.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/glucometerutils/support/tests/test_freestyle.py b/glucometerutils/support/tests/test_freestyle.py
new file mode 100644
index 0000000..fb3f3b9
--- /dev/null
+++ b/glucometerutils/support/tests/test_freestyle.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+#
+# SPDX-License-Identifier: MIT
+"""Tests for the common FreeStyle functions.."""
+
+# pylint: disable=protected-access,missing-docstring
+
+from absl.testing import absltest
+from glucometerutils.support import freestyle
+
+
+class TestFreeStyle(absltest.TestCase):
+ def test_outgoing_command(self):
+ """Test the generation of a new outgoing message."""
+
+ self.assertEqual(
+ b"\0\x17\7command\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
+ freestyle._FREESTYLE_MESSAGE.build(
+ {"message_type": 23, "command": b"command"}
+ ),
+ )